<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('产品管理')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <!--条件查询-->
                    <ul>
                        <li>
                            品名：<input type="text" name="managerName"/>
                        </li>


                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="pro:manager:add">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="pro:manager:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="pro:manager:remove">
                <i class="fa fa-remove"></i> 删除
            </a>

        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>

    </div>
</div>

<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('pro:manager:edit')}]];
    var removeFlag = [[${@permission.hasPermi('pro:manager:remove')}]];
    var viewFlag = [[${@permission.hasPermi('pro:manager:view')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    var prefix = ctx + "pro/manager";
/*https://tcr-5cb5kifq-1302869269.cos.ap-guangzhou.myqcloud.com/curtain01.jpg*/

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",

            exportUrl: prefix + "/export",
            sortName: "managerId",
            sortOrder:"asc",
            modalName: "产品管理",
            columns: [{
                checkbox: true
            },
                {
                    field: 'managerId',
                    title: '编号'
                },
                {
                    field: 'managerType',
                    title: '型号'
                },
                {
                    field: 'managerName',
                    title: '品名',
                    sortable: true
                },
                {
                    field: 'picturePath',
                    title: '图片',
                    sortable: true,
                    formatter : function (value, row, index) {
                        return "<img style='width: 70px;height: 70px;' src='"+value+"' alt=''>"
                    },
                   /* imgSrc:'https://tcr-5cb5kifq-1302869269.cos.ap-guangzhou.myqcloud.com/curtain01.jpg',*/
                },

                {
                    field: 'lineName',
                    title: '系列',
                    sortable: true
                },

                {
                    field: 'styleName',
                    title: '风格',
                    sortable: true
                },
                {
                    field: 'sizeName',
                    title: '规格',
                    sortable: true
                },
                {
                    field: 'textureName',
                    title: '材质',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        var managerid=row.managerId;
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.managerId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + viewFlag + '"  href="/pro/manager/view?managerId='+row.managerId+'"><i class="fa fa-street-view"></i>查看产品详情</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options)
    });
</script>
</body>
</html>